package com.tedu.myblog.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tedu.myblog.dao.UserDao;
import com.tedu.myblog.entity.User;
import com.tedu.myblog.service.UserService;
import com.tedu.myblog.util.MD5Utils;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;

	/**
	 * @Description:
	 * @Auther: ONESTAR
	 * @Date: 21:25 2020/5/27
	 * @Param: username:用户名；password:密码
	 * @Return: 返回用户对象
	 */
	@Override
	public User checkUser(String username, String password) {
		User user = userDao.findByUsernameAndPassword(username, MD5Utils.code(password));
		return user;

	}

}
